package com.lanhe.admin.controller.order;

import java.util.List;

import com.lanhe.common.annotation.Log;
import com.lanhe.common.core.controller.BaseController;
import com.lanhe.common.core.page.TableDataInfo;
import com.lanhe.common.enums.BusinessType;
import com.lanhe.common.utils.poi.ExcelUtil;
import com.lanhe.order.domain.LhOrdersLevel;
import com.lanhe.order.service.ILhOrdersLevelService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;


/**
 * 会员订单Controller
 * 
 * @author liang
 * @date 2024-01-06
 */
@RestController
@RequestMapping("/ordersLevel/ordersLevel")
public class LhOrdersLevelController extends BaseController
{
    @Autowired
    private ILhOrdersLevelService lhOrdersLevelService;

    /**
     * 查询会员订单列表
     */
    @PreAuthorize("@ss.hasPermi('ordersLevel:ordersLevel:list')")
    @GetMapping("/list")
    public TableDataInfo list(LhOrdersLevel lhOrdersLevel)
    {
        startPage();
        List<LhOrdersLevel> list = lhOrdersLevelService.selectLhOrdersLevelList(lhOrdersLevel);
        return getDataTable(list);
    }

    /**
     * 导出会员订单列表
     */
//    @PreAuthorize("@ss.hasPermi('ordersLevel:ordersLevel:export')")
    @Log(title = "会员订单", businessType = BusinessType.EXPORT)
        @PostMapping("/export")
    public void export(HttpServletResponse response, LhOrdersLevel lhOrdersLevel)
    {
        List<LhOrdersLevel> list = lhOrdersLevelService.selectLhOrdersLevelList(lhOrdersLevel);
        ExcelUtil<LhOrdersLevel> util = new ExcelUtil<LhOrdersLevel>(LhOrdersLevel.class);
        util.exportExcel(response, list, "会员订单数据");
    }

}
